package de.pharmacontrol.psa.beans.managed;

import java.util.Date;

import javax.ejb.EJB;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;

import de.pharmacontrol.psa.beans.interfaces.JCoBean;

@ManagedBean
@ApplicationScoped
public class SettingManagedBean {

	@EJB
	JCoBean jcoBean;
	
	/**
	 * PSA Version
	 */
	private String version = "0.9.1";

	public SettingManagedBean() {
	}

	public String getRfcName() {
		return jcoBean.getServerName();
	}

	public String getRfcVersion() {
		return jcoBean.getServerVersion();
	}

	public String getJcoVersion() {
		String version = jcoBean.getJCoVersion();
		if (version == null) {
			return "";
		}
		return version;
	}

	public String getJcoAbout() {
		String about = jcoBean.getJCoAbout();
		if (about == null) {
			return "";
		}
		return about.replace("\r\n", "<br/>");
	}

	public String getRfcStatus() {
		return jcoBean.getStatus();
	}

	public String getVersion() {
		return version;
	}

	public Date getToday() {
		return new Date();
	}

}
